import { getGlobalObject } from './utils/get-global';
import { globalTimer } from './timer';

/** 全局对象 */
export const global = getGlobalObject();

if (typeof global.setTimeout === 'undefined') {
    global.setTimeout = globalTimer.setTimeout;
    global.clearTimeout = globalTimer.clearTimeout;
}
if (typeof global.setImmediate === 'undefined') {
    global.setImmediate = global.setTimeout;
    global.clearImmediate = global.clearTimeout;
}